home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / TimeSliderMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  22.6 KB  |  796 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  28 June 1996
  22. // Author:         jb
  23. //
  24. //
  25. //  Procedure Name:
  26. //      TimeSliderMenu
  27. //
  28. //  Description:
  29. //        This menu attaches a popup menu to the
  30. //        timeslider, to allow for RMB cut/copy/paste
  31. //        type operations without having to go to
  32. //        the main menu for them.
  33. //
  34. //  Input Arguments:
  35. //      Parent to attach the menu to.
  36. //
  37. //  Return Value:
  38. //      None.
  39. //
  40.  
  41. global proc setPlaybackRangeToStartEnd() 
  42. //
  43. // Description:
  44. //    Start/End values come from the last read file.  If there
  45. //    isn't one (file->new) tell the user why.
  46. //    
  47. {
  48.     string $sceneConfig = "sceneConfigurationScriptNode";
  49.     string $oldSceneConfig = "animationScriptNode";
  50.  
  51.     //    If a pre-4.0 file is read, use the animationScriptNode.
  52.     //
  53.     if (`objExists $oldSceneConfig`) {
  54.         $sceneConfig = $oldSceneConfig;
  55.     }
  56.  
  57.     //     Look for the node named "sceneConfigurationScriptNode"
  58.     //
  59.     if (`objExists $sceneConfig`) {
  60.         string $script = `scriptNode -q -bs $sceneConfig`;
  61.         string $buff[];
  62.         tokenize $script ";" $buff;
  63.  
  64.         string $line;
  65.         for ($line in $buff) {
  66.             if (size(`match "playbackOptions" $line`) > 0) {
  67.                 evalEcho $line;
  68.                 break;
  69.             }
  70.         }
  71.     } else {
  72.         error( "No start/end found in this scene.  " +
  73.                "Use File->save to set the current Animation Range " + 
  74.                "as the start/end for this scene." );
  75.     }
  76. }
  77.  
  78. global proc setPlaybackRangeToMinMax()
  79. //
  80. // Description:
  81. //    Sometimes it's useful to set the playback range to be the 
  82. //    min/max of all the animation in the system.  We define that
  83. //    to be the first and last keys from all the time-based 
  84. //    animation curves we can find.
  85. //    
  86. {
  87.     //    Get a list of animCurve in the system. 
  88.     //    Check only for types created through
  89.     //    keyframing: time to linear, time to
  90.     //    angular, and time to unitless (for scale,
  91.     //    or user created attributes).
  92.     //
  93.     string $animTL[] = `ls -type animCurveTL`;
  94.     string $animTA[] = `ls -type animCurveTA`;
  95.     string $animTU[] = `ls -type animCurveTU`;
  96.     string $animTT[] = `ls -type animCurveTT`;
  97.  
  98.     float $keys[];
  99.     float $largestKey = -100000.0;
  100.     float $smallestKey = 100000.0;
  101.     int   $keyCount = 0;    
  102.  
  103.     for( $curve in $animTL ) {
  104.         int $last = `keyframe -q -kc $curve`;
  105.         if( $last > 0 ) {
  106.             $last--;
  107.         }
  108.  
  109.         $keys = `keyframe -index 0 -index $last -q -tc $curve`;
  110.         $keyCount += size( $keys );
  111.         for ( $key in $keys ) {
  112.             if( $key > $largestKey ) 
  113.                 $largestKey = $key;
  114.             if( $key < $smallestKey )
  115.                 $smallestKey = $key;
  116.         }
  117.     }
  118.             
  119.     for( $curve in $animTA ) {
  120.         int $last = `keyframe -q -kc $curve`;
  121.         if( $last > 0 ) {
  122.             $last--;
  123.         }
  124.  
  125.         $keys = `keyframe -index 0 -index $last -q -tc $curve`;
  126.         $keyCount += size( $keys );
  127.         for ( $key in $keys ) {
  128.             if( $key > $largestKey ) 
  129.                 $largestKey = $key;
  130.             if( $key < $smallestKey )
  131.                 $smallestKey = $key;
  132.         }
  133.     }
  134.             
  135.     for( $curve in $animTU ) {
  136.         int $last = `keyframe -q -kc $curve`;
  137.         if( $last > 0 ) {
  138.             $last--;
  139.         }
  140.  
  141.         $keys = `keyframe -index 0 -index $last -q -tc $curve`;
  142.         $keyCount += size( $keys );
  143.         for ( $key in $keys ) {
  144.             if( $key > $largestKey ) 
  145.                 $largestKey = $key;
  146.             if( $key < $smallestKey )
  147.                 $smallestKey = $key;
  148.         }
  149.     }
  150.  
  151.     for( $curve in $animTT ) {
  152.         int $last = `keyframe -q -kc $curve`;
  153.         if( $last > 0 ) {
  154.             $last--;
  155.         }
  156.  
  157.         $keys = `keyframe -index 0 -index $last -q -tc $curve`;
  158.         $keyCount += size( $keys );
  159.         for ( $key in $keys ) {
  160.             if( $key > $largestKey ) 
  161.                 $largestKey = $key;
  162.             if( $key < $smallestKey )
  163.                 $smallestKey = $key;
  164.         }
  165.     }
  166.  
  167.     // Only adjust the playback range if we've found animation.
  168.     //
  169.     if( $keyCount > 0 ) {
  170.         playbackOptions -min (int( $smallestKey )) -max (int( $largestKey ));
  171.     } else {
  172.         error( "No keys found; cannot determine min/max of animation range.");
  173.     }
  174. }
  175.  
  176. global proc setPlaybackRangeToHighlight() {
  177.     global string $gPlayBackSlider;
  178.  
  179.     if( `timeControl -q -rangeVisible $gPlayBackSlider` ) {
  180.         float $highlight[] = `timeControl -q -rangeArray $gPlayBackSlider`;
  181.         playbackOptions -min $highlight[0] -max $highlight[1];
  182.     } else {
  183.         error( "No range selected; use Shift-LMB to select a range." );
  184.     }
  185. }
  186.  
  187. global proc setPlaybackRangeToEnabledClips()
  188. //
  189. // Description:
  190. //    Sometimes it's useful to set the playback range to be the 
  191. //    min/max of all the enabled clips in the system. 
  192. //    
  193. {
  194.     //    Get a list of all of the clipScheduler nodes in the system.
  195.     //
  196.     string $clipSchedulers[] = `ls -type clipScheduler`;
  197.     if (`size($clipSchedulers)` == 0) {
  198.         error( "No clips found; cannot determine clip animation range.");
  199.     }
  200.  
  201.     float $lastTime = -100000.0;
  202.     float $firstTime = 100000.0;
  203.     int $nEnabledClips = 0;
  204.  
  205.     string $sch;
  206.     for ($sch in $clipSchedulers) {
  207.         string $scheduleList[] = `clipSchedule -q $sch`;
  208.         string $s;
  209.         for ($s in $scheduleList) {
  210.             string $buff[7];
  211.             tokenize($s,",",$buff);
  212.             
  213.             string $clip = $buff[0];
  214.             int $index = $buff[1];
  215.  
  216.             //    Check to see if this clip is enabled.
  217.             //
  218.             if (0 == `clipSchedule -ci $index -q -enable $sch`) {
  219.                 continue;
  220.             }
  221.  
  222.             float $start = `getAttr ($clip + ".startFrame")`;
  223.             float $duration = `getAttr ($clip + ".duration")`;
  224.             float $trim = `getAttr ($clip + ".startTrim")`;
  225.             float $scale = `getAttr ($clip + ".scale")`;
  226.             float $cycle = `getAttr ($clip + ".cycle")`;
  227.  
  228.             float $visibleStart = ($start + $trim);
  229.             float $end = $start + (($duration * $cycle) * $scale);
  230.  
  231.             if ($firstTime > $visibleStart) {
  232.                 $firstTime = $visibleStart;
  233.             }
  234.  
  235.             if ($lastTime < $end) {
  236.                 $lastTime = $end;
  237.             }
  238.  
  239.             $nEnabledClips++;
  240.         }
  241.     }
  242.  
  243.     if ($nEnabledClips == 0) {
  244.         error("No enabled clips found; cannot determine clip animation range.");
  245.     }
  246.  
  247.     int $intLast = int($lastTime);
  248.     if ($intLast < $lastTime) {
  249.         $lastTime += 1.0;
  250.     }
  251.  
  252.     playbackOptions -min (int( $firstTime )) -max (int( $lastTime ));
  253. }
  254.  
  255. global proc setPlaybackRangeToSound() {
  256.     global string $gPlayBackSlider;
  257.  
  258.     string $node = `timeControl -q -sound $gPlayBackSlider`;
  259.  
  260.     if( size( $node ) > 0 ) {
  261.         
  262.         // Truncate any fractional bits.
  263.         //
  264.         int $min = `sound -q -offset $node`;
  265.         int $max = int( $min + `sound -q -length $node` );
  266.         
  267.         playbackOptions -min $min -max $max;
  268.     } else {
  269.         error( "No sound displayed.  Import a sound file, then use the " +
  270.                "Sound menu to display it in the Time Slider." );
  271.     }
  272. }
  273.  
  274. global proc setPlaybackRangeToPrefs() 
  275. //
  276. // Description:
  277. //    Set the animation ranges to the prefs values.
  278. //    
  279. {
  280.     if( `optionVar -exists playbackMin`
  281.     &&  `optionVar -exists playbackMax`
  282.     &&  `optionVar -exists playbackMinRange`
  283.     &&  `optionVar -exists playbackMaxRange` )
  284.     {
  285.         float $min = `optionVar -q playbackMin`;
  286.         float $max = `optionVar -q playbackMax`;
  287.         float $minRange = `optionVar -q playbackMinRange`;
  288.         float $maxRange = `optionVar -q playbackMaxRange`;
  289.         
  290.         playbackOptions -min $min -max $max -ast $minRange -aet $maxRange;
  291.     }
  292. }
  293.  
  294. global proc timeSliderCutKey()
  295. //
  296. // Description:
  297. //    Targets depend on whether we're showing ticks for
  298. //     active or channel box attributes.
  299. //    
  300. {
  301.     global string $gPlayBackSlider;
  302.  
  303.     string $whichKeys = `timeControl -q -showKeys $gPlayBackSlider`;
  304.     if ($whichKeys == "none") {
  305.         return;
  306.     }
  307.  
  308.     string $cmd = ("cutKey -an objects -iub false -t " +
  309.                    `timeControl -q -range $gPlayBackSlider` +
  310.                    " -o keys");
  311.  
  312.     // Only check for "active" since we know that this menu
  313.     // item is disabled for the "none" case.
  314.     //
  315.     if( $whichKeys != "active" ) {
  316.         string $curves[] = `timeControl -q -animCurveNames $gPlayBackSlider`;
  317.         if( size( $curves ) > 0 ) {
  318.             for( $curve in $curves ) {
  319.                 $cmd = $cmd + " " + $curve;
  320.             }
  321.             eval $cmd;
  322.         }
  323.     } 
  324.     else {
  325.         string $members = expandSelectionConnection ("animationList");
  326.         if (($members == "") || ($members == "{}")) {
  327.             warning ("No objects selected to cut keys");
  328.         }
  329.         else {
  330.             eval ($cmd + " " + $members);
  331.         }
  332.     }
  333. }
  334.  
  335. global proc timeSliderCopyKey()
  336. //
  337. // Description:
  338. //    Targets depend on whether we're showing ticks for
  339. //     active or channel box attributes.
  340. //    
  341. {
  342.     global string $gPlayBackSlider;
  343.  
  344.     string $whichKeys = `timeControl -q -showKeys $gPlayBackSlider`;
  345.     if ($whichKeys == "none") {
  346.         return;
  347.     }
  348.  
  349.     string $cmd = ("copyKey -an objects -iub false -t " + 
  350.                    `timeControl -q -range $gPlayBackSlider` + 
  351.                    " -o keys");
  352.  
  353.     // Only check for "active" since we know that this menu
  354.     // item is disabled for the "none" case.
  355.     //
  356.     if( $whichKeys != "active" ) {
  357.         string $curves[] = `timeControl -q -animCurveNames $gPlayBackSlider`;
  358.         if( size( $curves ) > 0 ) {
  359.             for( $curve in $curves ) {
  360.                 $cmd = $cmd + " " + $curve;
  361.             }
  362.             eval $cmd;
  363.         }
  364.     }
  365.     else {
  366.         string $members = expandSelectionConnection ("animationList");
  367.         if (($members == "") || ($members == "{}")) {
  368.             warning ("No objects selected to copy keys");
  369.         }
  370.         else {
  371.             eval ($cmd + " " + $members);
  372.         }
  373.     }
  374. }
  375.  
  376. global proc timeSliderClearKey()
  377. //
  378. // Description:
  379. //    Targets depend on whether we're showing ticks for
  380. //     active or channel box attributes.
  381. //    
  382. {
  383.     global string $gPlayBackSlider;
  384.  
  385.     string $whichKeys = `timeControl -q -showKeys $gPlayBackSlider`;
  386.     if ($whichKeys == "none") {
  387.         return;
  388.     }
  389.  
  390.     string $cmd = ("cutKey -clear -iub false -an objects -t " + 
  391.                    `timeControl -q -range $gPlayBackSlider` +
  392.                    " -o keys");
  393.  
  394.     // Only check for "active" since we know that this menu
  395.     // item is disabled for the "none" case.
  396.     //
  397.     if( $whichKeys != "active" ) {
  398.         string $curves[] = `timeControl -q -animCurveNames $gPlayBackSlider`;
  399.         if( size( $curves ) > 0 ) {
  400.             for( $curve in $curves ) {
  401.                 $cmd = $cmd + " " + $curve;
  402.             }
  403.             eval $cmd;
  404.         }
  405.     } 
  406.     else {
  407.         string $members = expandSelectionConnection ("animationList");
  408.         if (($members == "") || ($members == "{}")) {
  409.             warning ("No objects selected to delete keys");
  410.         }
  411.         else {
  412.             eval ($cmd + " " + $members);
  413.         }
  414.     }
  415. }
  416.  
  417. global proc timeSliderSnapKey()
  418. //
  419. // Description:
  420. //    Targets depend on whether we're showing ticks for
  421. //     active or channel box attributes.
  422. //    
  423. {
  424.     global string $gPlayBackSlider;
  425.  
  426.     string $whichKeys = `timeControl -q -showKeys $gPlayBackSlider`;
  427.     if ($whichKeys == "none") {
  428.         return;
  429.     }
  430.  
  431.     string $cmd = ("snapKey -iub false -an objects -t " + 
  432.                    `timeControl -q -range $gPlayBackSlider`);
  433.  
  434.     // Only check for "active" since we know that this menu
  435.     // item is disabled for the "none" case.
  436.     //
  437.     if( $whichKeys != "active" ) {
  438.         string $curves[] = `timeControl -q -animCurveNames $gPlayBackSlider`;
  439.         if( size( $curves ) > 0 ) {
  440.             for( $curve in $curves ) {
  441.                 $cmd = $cmd + " " + $curve;
  442.             }
  443.             eval $cmd;
  444.         }
  445.     } 
  446.     else {
  447.         string $members = expandSelectionConnection ("animationList");
  448.         if (($members == "") || ($members == "{}")) {
  449.             warning ("No objects selected to snap keys");
  450.         }
  451.         else {
  452.             eval ($cmd + " " + $members);
  453.         }
  454.     }
  455. }
  456.  
  457. global proc timeSliderPasteKey(int $connect)
  458. //
  459. // Description:
  460. //    The "pasteKey" command issued depends on whether
  461. //    a highlighted range is visible on the time slider.  
  462. //    
  463. {
  464.     global string $gPlayBackSlider;
  465.  
  466.     string $whichKeys = `timeControl -q -showKeys $gPlayBackSlider`;
  467.     if ($whichKeys == "none") {
  468.         return;
  469.     }
  470.  
  471.     global string $gChannelBoxName;
  472.     string $cmd;
  473.  
  474.     if( `timeControl -q -rv $gPlayBackSlider` ) {
  475.         string $timeRange = `timeControl -q -range $gPlayBackSlider`;
  476.         $cmd = ("pasteKey -an objects -connect " + $connect + " -t " + $timeRange + " -includeUpperBound false -o scaleReplace");
  477.     } 
  478.     else {
  479.         float $time = `currentTime -q`;
  480.         $cmd = ("pasteKey -an objects -connect " + $connect + " -t " + $time);
  481.     }
  482.     
  483.     // Only check for "active" since we know that this menu
  484.     // item is disabled for the "none" case.
  485.     //
  486.     if( $whichKeys != "active" ) {
  487.         string $main[]  = `channelBox -q -sma $gChannelBoxName`;
  488.         string $shape[] = `channelBox -q -ssa $gChannelBoxName`;
  489.         string $hist[]  = `channelBox -q -sha $gChannelBoxName`;
  490.  
  491.         // Build up the list of attrs selected in the channel box 
  492.         //
  493.         if(( size( $main ) > 0 ) 
  494.         || ( size( $shape ) > 0 )
  495.         || ( size( $hist ) > 0 ))
  496.         {
  497.             for( $attr in $main ) {
  498.                 $cmd = $cmd + " ." + $attr;
  499.             }
  500.             for( $attr in $shape ) {
  501.                 $cmd = $cmd + " ." + $attr;
  502.             }
  503.             for( $attr in $hist ) {
  504.                 $cmd = $cmd + " ." + $attr;
  505.             }
  506.  
  507.             eval $cmd;
  508.         }
  509.     } 
  510.     else {
  511.         string $members = expandSelectionConnection ("animationList");
  512.         if (($members == "") || ($members == "{}")) {
  513.             warning ("No objects selected to paste keys");
  514.         }
  515.         else {
  516.             eval ($cmd + " " + $members);
  517.         }
  518.     }
  519. }
  520.  
  521.  
  522. global proc timeSliderEditKeys( string $type )
  523. //
  524. // Description:
  525. //    
  526. //    
  527. {
  528.     global string $gPlayBackSlider;
  529.  
  530.     string $whichKeys = `timeControl -q -showKeys $gPlayBackSlider`;
  531.     if ($whichKeys == "none") {
  532.         return;
  533.     }
  534.  
  535.     string $cmd = "keyframe ";
  536.     switch ($type) {
  537.     case "makeKey":
  538.         $cmd = $cmd + "-breakdown false ";
  539.         $cmd = $cmd + (" -an objects -iub false -t " + 
  540.                 `timeControl -q -range $gPlayBackSlider`);
  541.         break;
  542.     case "makeBreakdown":
  543.         $cmd = $cmd + "-breakdown true ";
  544.         $cmd = $cmd + (" -an objects -iub false -t " + 
  545.                 `timeControl -q -range $gPlayBackSlider`);
  546.         break;
  547.     case "addInbetween":
  548.         $cmd = $cmd + "-time \"" + `currentTime -query` + ":\" " +
  549.             "-relative -timeChange 1 -option over";
  550.         break;
  551.     case "removeInbetween":
  552.         $cmd = $cmd + "-time \"" + `currentTime -query` + ":\" " +
  553.             "-relative -timeChange -1 -option over";
  554.         break;
  555.     }
  556.  
  557.     if( $whichKeys != "active" ) {
  558.         string $curves[] = `timeControl -q -animCurveNames $gPlayBackSlider`;
  559.         if( size( $curves ) > 0 ) {
  560.             for( $curve in $curves ) {
  561.                 $cmd = $cmd + " " + $curve;
  562.             }
  563.             eval $cmd;
  564.         }
  565.     } 
  566.     else {
  567.         string $members = expandSelectionConnection ("animationList");
  568.         if (($members == "") || ($members == "{}")) {
  569.             warning ("No objects selected to edit keys");
  570.         }
  571.         else {
  572.             eval ($cmd + " " + $members);
  573.         }
  574.     }
  575. }
  576.  
  577. global proc timeSliderSetTangent( string $type )
  578. //
  579. // Description:
  580. //    
  581. //    
  582. {
  583.     global string $gPlayBackSlider;
  584.  
  585.     string $whichKeys = `timeControl -q -showKeys $gPlayBackSlider`;
  586.     if ($whichKeys == "none") {
  587.         return;
  588.     }
  589.  
  590.     string $cmd = "keyTangent";
  591.     if ($type != "step") {
  592.         $cmd = ($cmd + " -itt " + $type);
  593.     }
  594.     $cmd = ($cmd + " -ott " + $type + 
  595.                    " -an objects -iub false -t " + 
  596.                    `timeControl -q -range $gPlayBackSlider`);
  597.  
  598.     if( $whichKeys != "active" ) {
  599.         string $curves[] = `timeControl -q -animCurveNames $gPlayBackSlider`;
  600.         if( size( $curves ) > 0 ) {
  601.             for( $curve in $curves ) {
  602.                 $cmd = $cmd + " " + $curve;
  603.             }
  604.             eval $cmd;
  605.         }
  606.     } 
  607.     else {
  608.         string $members = expandSelectionConnection ("animationList");
  609.         if (($members == "") || ($members == "{}")) {
  610.             warning ("No objects selected to set tangents");
  611.         }
  612.         else {
  613.             eval ($cmd + " " + $members);
  614.         }
  615.     }
  616. }
  617.  
  618.  
  619. global proc updateTimeSliderMenu()
  620. //
  621. // Description:
  622. //    Grey out menu entries based on the "Time slider show
  623. //    ticks" option
  624. //    
  625. {
  626.     global string $gPlayBackSlider;
  627.  
  628.     string $whichKeys = `timeControl -q -showKeys $gPlayBackSlider`;
  629.  
  630.     if( $whichKeys == "none" ) {
  631.         menuItem -e -enable false timeSliderCutKeyItem;
  632.         menuItem -e -enable false timeSliderCopyKeyItem;
  633.         menuItem -e -enable false timeSliderPasteKeyItem;
  634.         menuItem -e -enable false timeSliderClearKeyItem;
  635.         menuItem -e -enable false timeSliderSnapKeyItem;
  636.         menuItem -e -enable false timeSliderKeysItem;
  637.         menuItem -e -enable false timeSliderTangentsItem;
  638.     } else {
  639.         menuItem -e -enable true timeSliderCutKeyItem;
  640.         menuItem -e -enable true timeSliderCopyKeyItem;
  641.         menuItem -e -enable true timeSliderPasteKeyItem;
  642.         menuItem -e -enable true timeSliderClearKeyItem;
  643.         menuItem -e -enable true timeSliderSnapKeyItem;
  644.         menuItem -e -enable true timeSliderKeysItem;
  645.         menuItem -e -enable true timeSliderTangentsItem;
  646.     }
  647. }
  648.  
  649.  
  650. global proc TimeSliderMenu( string $parent )
  651. {
  652.     popupMenu -aob true -b 3 -mm 0 -p $parent -pmc updateTimeSliderMenu 
  653.         TimeSliderMenu;
  654.  
  655.         menuItem  -l "Cut"
  656.             -annotation "Cut Keys: Remove keys and place on animation clipboard"
  657.             timeSliderCutKeyItem;
  658.         menuItem  -l "Copy"
  659.             -annotation "Copy Keys: Copy keys and place on animation clipboard"
  660.             timeSliderCopyKeyItem;
  661.         menuItem  -l "Paste" -subMenu yes -tearOff yes timeSliderPasteKeyItem;
  662.             menuItem -l "Paste"
  663.                 -annotation "Paste Keys: Paste keys from animation clipboard"
  664.                 timeSliderPasteItem;
  665.             menuItem -l "Paste Connect"
  666.                 -annotation "Paste Connect: Paste and connect keys from animation clipboard"
  667.                 timeSliderPasteConnectItem;
  668.             setParent -menu ..;
  669.         menuItem  -l "Delete"
  670.             -annotation "Delete Keys: Delete keys but do not place on animation clipboard"
  671.             timeSliderClearKeyItem;
  672.         menuItem  -l "Snap"
  673.             -annotation "Snap Keys: Snap keys to integer times"
  674.             timeSliderSnapKeyItem;
  675.         menuItem -l "Keys" -subMenu yes -tearOff yes timeSliderKeysItem;
  676.             menuItem -l "Convert to Key"
  677.                 -ann "Convert to Key: Change existing breakdowns into keys"
  678.                 timeSliderMakeKeyItem;
  679.             menuItem -l "Convert to Breakdown"
  680.                 -ann "Convert to Breakdown: Change existing keys into breakdowns"
  681.                 timeSliderMakeBreakdownItem;
  682.             menuItem -l "Add Inbetween"
  683.                 -ann "Add Inbetween: Insert inbetween at current time"
  684.                 timeSliderAddInbetweenItem;
  685.             menuItem -l "Remove Inbetween"
  686.                 -ann "Remove Inbetween: Remove inbetween at current time"
  687.                 timeSliderRemoveInbetweenItem;
  688.             setParent -menu ..;
  689.         menuItem -l "Tangents" -subMenu yes -tearOff yes timeSliderTangentsItem;
  690.             menuItem -l "Spline"
  691.                 -ann "Spline Tangents: Set in- and out-tangents to Spline"
  692.                 timeSliderSplineItem;
  693.             menuItem -l "Linear"
  694.                 -ann "Linear Tangents: Set in- and out-tangents to Linear"
  695.                 timeSliderLinearItem;
  696.             menuItem -l "Clamped"
  697.                 -ann "Clamped Tangents: Set in- and out-tangents to Clamped"
  698.                 timeSliderClampedItem;
  699.             menuItem -l "Stepped"
  700.                 -ann "Stepped Tangents: Set out-tangent to Stepped"
  701.                 timeSliderSteppedItem;
  702.             menuItem -l "Flat"
  703.                 -ann "Flat Tangents: Set in- and out-tangents to Flat"
  704.                 timeSliderFlatItem;
  705.             setParent -menu ..;
  706.  
  707.         menuItem -divider true;
  708.  
  709.         menuItem -l "Playback Looping" 
  710.             -subMenu true -tearOff yes 
  711.             playbackLoopItem;
  712.  
  713.             menuItem -l "Once" 
  714.                 -c "evalEcho playbackOptions -l \"once\""
  715.                 -ann "Playback Looping: Set to Once"
  716.                 playbackLoopOnceItem;
  717.             menuItem -l "Oscillate" 
  718.                 -c "evalEcho playbackOptions -l \"oscillate\""
  719.                 -ann "Playback Looping: Set to Oscillate"
  720.                 playbackLoopOscillateItem;
  721.             menuItem -l "Continuous" 
  722.                 -c "evalEcho playbackOptions -l  \"continuous\"" 
  723.                 -ann "Playback Looping: Set to Continuous"
  724.             playbackLoopContinuousItem;
  725.  
  726.             setParent -m ..;
  727.               
  728.         menuItem -l "Set Range to" -subMenu true -tearOff yes playbackRangeItem;
  729.  
  730.             menuItem -l "Start/End" -c "evalEcho setPlaybackRangeToStartEnd" 
  731.                 -ann "Playback Range: Set to times stored with current scene"
  732.                 playbackRangeStartEndItem;
  733.             menuItem -l "Min/Max" -c "evalEcho setPlaybackRangeToMinMax" 
  734.                 -ann "Playback Range: Set to times of first and last keys"
  735.                 playbackRangeMinMaxItem;
  736.             menuItem -l "Selected" -c "evalEcho setPlaybackRangeToHighlight" 
  737.                 -ann "Playback Range: Set to currently selected range in Time Slider"
  738.                 playbackRangeHighlightItem;
  739.             menuItem -l "Enabled Clips" -c "evalEcho setPlaybackRangeToEnabledClips"
  740.                 -ann "Playback Range: Set to times of the enabled clips."
  741.                 playbackRangeEnabledClipsItem;
  742.             menuItem -l "Sound Length" -c "evalEcho setPlaybackRangeToSound" 
  743.                 -ann "Playback Range: Set to length of currently displayed sound"
  744.                 playbackRangeSoundItem;
  745.             menuItem -l "Preferences" -c "evalEcho setPlaybackRangeToPrefs" 
  746.                 -ann "Playback Range: Set to values in Animation Preferences"
  747.                 playbackRangePrefsItem;
  748.  
  749.             setParent -m ..;
  750.  
  751.         menuItem -e -c "evalEcho timeSliderCutKey" timeSliderCutKeyItem;
  752.         menuItem -e -c "evalEcho timeSliderCopyKey" timeSliderCopyKeyItem;
  753.         menuItem -e -c "evalEcho \"timeSliderPasteKey false\"" timeSliderPasteItem;
  754.         menuItem -e -c "evalEcho \"timeSliderPasteKey true\"" timeSliderPasteConnectItem;
  755.         menuItem -e -c "evalEcho timeSliderClearKey" timeSliderClearKeyItem;
  756.         menuItem -e -c "evalEcho timeSliderSnapKey" timeSliderSnapKeyItem;
  757.  
  758.         menuItem -e -c "evalEcho \"timeSliderEditKeys makeKey\"" timeSliderMakeKeyItem;
  759.         menuItem -e -c "evalEcho \"timeSliderEditKeys makeBreakdown\"" timeSliderMakeBreakdownItem;
  760.         menuItem -e -c "evalEcho \"timeSliderEditKeys addInbetween\"" timeSliderAddInbetweenItem;
  761.         menuItem -e -c "evalEcho \"timeSliderEditKeys removeInbetween\"" timeSliderRemoveInbetweenItem;
  762.  
  763.         menuItem -e -c "evalEcho \"timeSliderSetTangent spline\"" timeSliderSplineItem;
  764.         menuItem -e -c "evalEcho \"timeSliderSetTangent linear\"" timeSliderLinearItem;
  765.         menuItem -e -c "evalEcho \"timeSliderSetTangent clamped\"" timeSliderClampedItem;
  766.         menuItem -e -c "evalEcho \"timeSliderSetTangent step\"" timeSliderSteppedItem;
  767.         menuItem -e -c "evalEcho \"timeSliderSetTangent flat\"" timeSliderFlatItem;
  768.  
  769.         string $soundMenu = `menuItem -label "Sound"
  770.             -subMenu true -allowOptionBoxes true`;
  771.  
  772.         menuItem -e -pmc ( 
  773.             "updateSoundMenu { " +                         
  774.             "\"" + $soundMenu + "\", " +                   // menu name
  775.             "\"1\", " +                                       // use radios
  776.             "\"setSoundDisplay %s 1\", " +                   // cmd when selected
  777.             "\"Display sound in Time Slider for %s\", " +  // annotation 
  778.             "\"setSoundDisplay `timeControl -q -s " +       // off radio cmd
  779.                     "$gPlayBackSlider` 0\", " +               //     (cont'd)
  780.             "\"showEditor %s\" " +                           // option box cmd
  781.             "};" 
  782.             )                        
  783.             $soundMenu;
  784.  
  785.         setParent -m ..;
  786.  
  787.         menuItem -l "Playblast..." 
  788.             -c "performPlayblast 3" 
  789.             -annotation "Playblast: Preview animation by screen-capturing frames"
  790.             timeSliderPlayblastItem;
  791.             menuItem -optionBox true -c "performPlayblast 4" 
  792.                 timeSliderPlayblastOptionItem;
  793.  
  794.     setParent -m ..;
  795. }
  796.